
import Vue from 'vue';
import confirm from './rm_RptunitStyle.vue';

let ConfirmConstructor = Vue.extend(confirm);
let rm_RptunitStyle = function(text) {
    return new Promise((res, rej) => { //promise封装，confirm执行res，cancel执行rej
        let confirmDom = new ConfirmConstructor({
            el: document.createElement('div')
        })
        document.body.appendChild(confirmDom.$el); //new一个对象插入body里面
        confirmDom.text = text;
        confirmDom.isSuccess = function() {
            res({
                code: confirmDom.code,
                name: confirmDom.name,
            })
        }
    })
}
export default rm_RptunitStyle;